﻿using System;
using DapperExtensions.Mapper;
using Newtonsoft.Json;
using ZilLion.Service.Core.Domain.EntityBase.JsonConverter;

namespace ZL.CRM.CommonEntity.Common
{
    public class CrmErrlog
    {

        /// <summary>
        ///  流水值
        /// </summary>
        public int Clsn { get; set; }

        /// <summary>
        ///  错误级别 0-错误 1-警告
        /// </summary>
        public short Clerrtype { get; set; }

        /// <summary>
        ///  错误产生时间
        /// </summary>
        [JsonConverter(typeof(ChinaDateTimeConverter))]
        public DateTime? Cldate { get; set; }

        /// <summary>
        ///  操作内容
        /// </summary>
        public string Clact { get; set; }

        /// <summary>
        ///  错误描述（accrecord对外发送的json）
        /// </summary>
        public string Cldesc { get; set; }
    }

    public class CrmErrlogMapper : ClassMapper<CrmErrlog>
    {
        public CrmErrlogMapper()
        {
            Table("#errlog");
            Map(f => f.Clact).Column("Clact");
            Map(f => f.Cldate).Column("Cldate");
            Map(f => f.Cldesc).Column("Cldesc");
            Map(f => f.Clerrtype).Column("Clerrtype");
            Map(f => f.Clsn).Column("Clsn");
        }
    }
}
